this._candidatePopup = new IBusCandidatePopup.CandidatePopup();
this._panelService = null;
- this._engines = {};
+ this._engines = new Map();
this._ready = false;
this._registerPropertiesId = 0;
this._currentEngineName = null;
this._panelService = null;
this._candidatePopup.setPanelService(null);
- this._engines = {};
+ this._engines.clear();
this._ready = false;
this._registerPropertiesId = 0;
this._currentEngineName = null;
if (enginesList) {
for (let i = 0; i < enginesList.length; ++i) {
let name = enginesList[i].get_name();
- this._engines[name] = enginesList[i];
+ this._engines.set(name, enginesList[i]);
}
this._updateReadiness();
} else {
}
_updateReadiness() {
- this._ready = (Object.keys(this._engines).length > 0 &&
- this._panelService != null);
+ this._ready = this._engines.size > 0 && this._panelService != null;
this.emit('ready', this._ready);
}
}
getEngineDesc(id) {
- if (!this._ready || !this._engines.hasOwnProperty(id))
+ if (!this._ready || !this._engines.has(id))
return null;
- return this._engines[id];
+ return this._engines.get(id);
}
setEngine(id, callback) {